from ronglian_sms_sdk import SmsSDK


class SmsUtil:
    __instance = None

    def __new__(cls, *args, **kwargs):
        if not cls.__instance:
            cls.__instance = super().__new__(cls, *args, **kwargs)
            cls.smsSdk = SmsSDK(accId='8aaf07087dc23905017dd5cf5b2c045b',
                                accToken='a2476b89301444d9bc68c27d17a952f9',
                                appId='8aaf07087dc23905017dd5cf5c250461')
        return cls.__instance

    def send_message(self, mobile='18327651492', tid='1', code='1234'):
        self.smsSdk.sendMessage(tid=tid, mobile=mobile, datas=(code, 5))
